package com.example.workrecord.common;

import com.querydsl.jpa.impl.JPAQueryFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import javax.persistence.EntityManager;
/**
  *@ClassName: QueryDslTool
  *@Description QueryDslTool
  *@Author Mr.Bu
  *@Date 2020/4/26 11:16
  *@Version: 1.0
  */
@Component
public class QueryDslTool {
    @Autowired
    EntityManager entityManager;

    @Bean
    @Autowired
    public JPAQueryFactory jpaQuery(EntityManager entityManager) {
        return new JPAQueryFactory(entityManager);
    }
}
